Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been motivate to write
rs2bril
like the currentts2bril
. I didn't quite realize until half way through that the stalled #107 also has an implementation of ars2bril
like tool. We approached the problem in a similar way so there was some repeated work though we are targeting different extensions of Bril so this pr has some set of new contributions. The implementation structure is similar enough that https://www.cs.cornell.edu/courses/cs6120/2020fa/blog/bril-algebraic-data-types/ can be used as an overview.#107's
rs2bril
targets core Bril + ADT's.ts2bril
targets core Bril + Floats. This pr implements ars2bril
tool which targets core Bril + Floats + Memory. I've added a full list of limitations that I'm aware of to the README, I will highlight a few:println!
is expected to be valid rust unlike in Algebraic types extension #107, however the format string is ignored during compilation and you can only pass variables as arguments.drop
to compile tofree
. Programmers need to manually manage their memory(by dropping arrays). This could be a use case for https://www.cs.cornell.edu/courses/cs6120/2020fa/blog/asmm/ .It can provide source positions via the
-p
flag though many are probably off/missing.example.rs
has some example syntax that is supported. I've added a set of tests which are equivalent to thets2bril
tests plus more complicated benchmarks likeackermann.rs
,riemann.rs
andcholesky.rs
(which is probably the best representation of whatrs2bril
can do).